home *** CD-ROM | disk | FTP | other *** search
/ WWII Attack! from Pearl Harbor to Potsdam / WWII Attack - From Pearl Harbor to Potsdam - Disc 3.iso / pc / us / shared.cst / 00058_Script_click behavior < prev    next >
Text File  |  1999-11-23  |  3KB  |  74 lines

  1. --*** A Simple click Button score behavior script ***
  2. --        Revised 12/7/97
  3.  
  4. property downSnd
  5. property upSnd
  6. property Action
  7. property WhichLabel
  8.  
  9. on mouseDown
  10.   
  11.   -- click "blip2"
  12.   Click downSnd, upSnd
  13.   -- 'mouseup' action
  14.   Play the frame +1
  15.   
  16. end
  17.  
  18. on getPropertyDescriptionList
  19.         global ibcDefaultParams
  20.   if listp(ibcDefaultParams) then
  21.     return ibcDefaultParams
  22.   else
  23.         set description = [:]
  24.     addProp     description,#DownSnd,[#default:"Silence",#format:#sound,#comment:"Down Sound Member:"]
  25.         addProp     description,#UpSnd,[#default:"Silence",#format:#sound,#comment:"Up Sound Member:"]
  26.     addProp     description,#Action,[#default: #"None",#range: [ #"None", #"Go to marker", #"Play marker" ], #format:#symbol,#comment:"MouseUp Action:"]
  27.     addProp description, #WhichLabel, [ #comment: "Destination Marker:",  #format: #marker, #default:  "next" ]
  28.     return description
  29.   end if
  30. end
  31.  
  32. on btnSound asoundName -- does a little validation
  33.   if stringp(asoundName) and asoundName <> "Silence" then
  34.     puppetSound asoundName
  35.   end if
  36. end
  37.  
  38. on  getBehaviorDescription
  39.   return "- Click Behavior -"¨
  40. & return & "Defined: controls a dual-image button."¨
  41. & return & "Intended Use: to give user a simple audio + visual feedback that they've engaged a control. Rolling off button during mouseDown will disengage."¨
  42. & return & return & "- Properties -"¨
  43.   & return & "Down Sound: assigns a mouseDown button sound."¨
  44.   & return & "Up Sound: assigns a mouseUp button sound."¨
  45. & return & "MouseUp Action: assigns a button course of action."¨
  46. & return & "  (Note: Select 'None' if you plan to add a seperate mouseUp behavior to this button)"¨
  47. & return & "Destination Marker: assigns a destination to the course of action."¨
  48. & return & return & "(Explore the 'LookHere' folder on the CD-Rom for examples of each behavior)"
  49. end
  50.  
  51. ---  the handler code ---
  52.  
  53. on click  downSound, upSound
  54.   
  55.   set emem = the membernum of sprite clickon()
  56.   if stringP(downSound) then btnSound downSound
  57.   updatestage
  58.   set the membernum of sprite clickon() = emem + 1
  59.   updatestage
  60.   repeat while the stillDown or soundBusy (1)
  61.     if rollover( clickon() ) then set the membernum of sprite clickon() = emem + 1 -- added Apple legal code
  62.     else set the membernum of sprite clickon() = emem
  63.     updateStage
  64.   end repeat
  65.   if stringP(upSound) and rollover( clickon()) then btnSound upSound
  66.   updatestage
  67.   set the membernum of sprite clickon() = emem
  68.   updatestage
  69.   repeat while soundBusy (1)
  70.   end repeat
  71.   puppetSound 0
  72.   updateStage
  73. end click
  74.